package me.hys.service.doctor.impl;

import me.hys.dao.doctor.IDoctorInfoMapper;
import me.hys.entity.doctor.DoctorInfoEntity;
import me.hys.service.doctor.IDoctorInfoManager;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

/**
 * Author: @author HYS . <br>
 * Date: 2015-10-13 下午9:49:47 . <br>
 * Function: 医生状态信息
 */
@Service
@Transactional
class DoctorInfoManagerImpl implements IDoctorInfoManager {
	@Autowired
	private IDoctorInfoMapper mapper;

	/**
	 * @Title : saveOrUpdate
	 * @Description :
	 */
	@Override
	public void saveOrUpdate(DoctorInfoEntity entity) {
		if (mapper.findInfo(entity.getDoctorId()) > 0) {
			mapper.update(entity);
		} else {
			mapper.save(entity);
		}
	}
}
